package org.huang.sample15.controller;

import org.huang.sample15.bo.Dept;
import org.huang.sample15.dao.DeptAnnoMapper;
import org.huang.sample15.dao.DeptXmlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController {

    @Autowired
    private DeptXmlMapper deptXmlMapper;

    @Autowired
    private DeptAnnoMapper deptAnnoMapper;


    @GetMapping("/index")
    public List<Dept> index(){
        System.out.println("index");
        return deptXmlMapper.selectAll();
    }

    @GetMapping("/index2")

    public List<Dept> index2(){
        System.out.println("index2");
        return deptAnnoMapper.findAll();
    }
}
